On analysing expressions
On analysing expressions
Overview
Overview
◼ Expression analysis is concerned with the grade, identification and extraction of the various types of subexpressions which compose Grassmann expressions. See the tutorial: for a discussion of Grassmann expressions.
◼ A Grassmann expression may be composed of various types of symbol and various types of products and complements. Types of symbol may include scalar symbols, numeric quantities, vector symbols, basis symbols, metric symbols, graded symbols or special symbols. Types of product may include the exterior, regressive, interior, generalized, hypercomplex and Clifford products. Types of complement may include the Grassmann complement or the vector-space complement.
◼ Each of these expressions, and the subexpressions from which it is composed will have a grade. This grade may be a single integer, as in the case of an element residing entirely in just one of the exterior product spaces, or it may be a list of integers if it is a more general element of the algebra.
◼ Expressions and subexpressions may also be of specific type. For example, they may be of even grade, an inner product, a simple exterior product, a basis element symbol, or in weighted point form. These may be identified by corresponding predicates, whose names (following Mathematica convention), all end in Q: , , , , .
◼ Symbols or subexpressions which can be identified by a predicate can be extracted from an expression using .
The grade of an expression
The grade of an expression
◼ Every Grassmann expression has a grade. Scalars have grade 0. Vectors have grade 1. Bivectors have grade 2. m-elements have grade m. The grade of a sum of elements of different grades is represented in GrassmannAlgebra by a list of the grades. The grade of zero is represented by the special symbol ★0.
◼ Strictly speaking, each exterior linear space of a Grassmann algebra will have its own zero, with a grade equal to the grade of the space. For simplicity, in GrassmannAlgebra, we choose to represent all these zeros by the one symbol 0. Thus, the symbol 0 has an ambiguous grade. To represent this ambiguous grade, GrassmannAlgebra uses the symbol ★0. See the tutorial: .
◼ determines the grade of a Grassmann expression taking into account the dimension of the space. RawGrade effectively assumes the dimension of the space is arbitrarily large.
◼ , , , , and are predicates for testing the grade of an expression.
◼ All the functions take a second argument which allows you to temporarily assert the grade of symbols within an expression. See the tutorial: .
Examples
Examples
In[130]:=
[1][x],
[2][x⋀y],
[{1,2}][x+x⋀y]
GradeQ |
GradeQ |
GradeQ |
Out[130]=
{True,True,True}
Types of expression
Types of expression
◼ GrassmannAlgebra Expression Analysis and Expression Transformation functions are designed to operate only on Grassmann expressions. See the tutorial: for a discussion of Grassmann expressions. will test any expression and return if it conforms to the definition of a Grassmann expression, and otherwise.
◼ More specific Grassmann expressions involve those which are zero, scalar, an inner product, those clearly a simple product, and those which are not expressed as a simple product, but can be reduced to one.
◼ tests whether a Grassmann expression is an inner product, that is, an interior product of elements of the same (single) grade. Inner products are scalar quantities.
◼ tests whether a Grassmann expression is expressed as a simple product, that is, one expressed as the exterior product of 1-element factors.
◼ tests whether a Grassmann expression is simple (that is, can be reduced to a simple product), even though it may not be expressed as such.
Examples
Examples
◼ All inner products are scalars.
In[139]:=
[⊖],
[⊖]
InnerProductQ |
X
m
Y
m
ScalarQ |
X
m
Y
m
Out[139]=
{True,True}
◼ The exterior product of two 1-elements is both simple, and a simple product.
In[135]:=
[x⋀(y+z)],
[x⋀(y+z)]
SimpleQ |
SimpleProductQ |
Out[135]=
{True,True}
But when expanded, this 2-element, whilst remaining simple, is no longer a simple product.
In[136]:=
[x⋀y+x⋀z],
[x⋀y+x⋀z]
SimpleQ |
SimpleProductQ |
Out[136]=
{True,False}
Types of symbol
Types of symbol
◼ A Grassmann symbol is any declared basis, scalar, vector, or metric symbol; or any of the special scalars; or any graded symbol. To check whether it is any of these you can use .
◼ To check if a given symbol is a currently declared basis element symbol, scalar symbol, vector symbol or metric symbol, you can use , , , or .
◼ is a collection of object aliases and object patterns which GrassmannAlgebra treats as scalars. To check if your current version of GrassmannAlgebra defines a given symbol as a special scalar, apply .
Examples
Examples
◼ Although both have grade 1, a basis symbol is considered distinct from a vector symbol.
In[144]:=
[],
[]
BasisSymbolQ |
e
1
VectorSymbolQ |
e
1
Out[144]=
{True,False}
◼ Here is the list of special scalars.
In[140]:=
SpecialScalars |
Out[140]=
★g,★n,,★λ,★0,,★c,_,
_,_,_
★σ
★t
(-1)
The hypercomplex sign (See the Grassmann Algebra Book, Chapter 11: Exploring Hypercomplex Algebra) is of grade zero (a scalar), a Grassmann symbol, and a special scalar.
3,2,1
★σ
In[145]:=
[0],
,
,
GradeQ |
3,2,1
★σ
GrassmannSymbolQ |
3,2,1
★σ
SpecialScalarQ |
3,2,1
★σ
ScalarQ |
3,2,1
★σ
Out[145]=
{True,True,True,True}
Types of product
Types of product
◼ A Grassmann product is any of the exterior, regressive, interior, generalized, hypercomplex, or Clifford products.
◼ To check if a Grassmann product is of a given type you can use , , , , , or .
Examples
Examples
◼ Because the grades of the factors are the same, this interior product is also an inner product.
In[148]:=
[(x⋀y)⊖(u⋀v)],
[(x⋀y)⊖(u⋀v)]
InteriorProductQ |
InnerProductQ |
Out[148]=
{True,True}
◼ These functions do not check if the product is a Grassmann expression.
In[152]:=
_⋀
⋀A,
_⋀
⋀A
ExteriorProductQ |
|
GrassmannExpressionQ |
|
Out[152]=
{True,False}
Types of complement
Types of complement
◼ A Grassmann complement is either the normal Grassmann complement () or the complement restricted to the vector subspace of a point space ().
◼ To check if a Grassmann complement is of either type you can use , or .
Examples
Examples
◼ These functions do not check if the expression is a Grassmann expression.
In[153]:=
,
GrassmannComplementQ |
_⋀
⋀A
|
VectorSpaceComplementQ |
_⋀
⋀A
|
Out[153]=
{True,True}
Types of element form
Types of element form
◼ In GrassmannAlgebra, elements may be unigraded or multigraded. The terms of a unigraded element all have the same grade, whereas the terms of a multigraded element may have different grades.
◼ GrassmannAlgebra assumes that a unigraded element may be either simple, or not simple. A simple element is one which may be expressed as the exterior product of 1-element factors. A non-simple element cannot be so expressed.
◼ A unigraded element may also be either in a Grassmann algebra based on a vector space, or in one based on a point space. A point space differs from a vector space by specifically including a special element called the (alias ) in its basis.
★
◼ Vector-space-type elements are unigraded elements which do not include the in their expression. Examples are vectors, bivectors and trivectors, or, more generally, m-vectors. These forms may be tested by , , , , or . In general, except for vectors, (n-1)-vectors, and denizens of spaces with n ≤ 3, vector-space-type elements may be simple or non-simple.
◼ Point-space-type elements are those in which the occurs in their expression. Examples are points, weighted points, line elements, screw elements, plane elements and m-plane elements. These forms may be tested by , , , , , or . Except for various special complexes like screw elements, point-space-type elements are normally defined to be simple.
★
◼ Note carefully, that these predicates test the form of the expression to see if it is simple. If the expression is a sum, they will deem it is not a simple form even though the actual expression may be able to be reduced to a simple element.
Examples
Examples
◼ Suppose we are in a space with the default preferences declared, and have a list of vector-space-type elements:
In[16]:=
★A;V={x+y,x⋀y+x⋀z,x⋀y⋀z+u⋀v⋀w};
In[17]:=
VectorFormQ |
Out[17]=
{True,False,False}
The expression has the form of a bivector but not the form of a simple bivector (even though it is actually simple).
x⋀y+x⋀z
In[19]:=
[V],
[V]
BivectorFormQ |
SimpleBivectorFormQ |
Out[19]=
{{False,True,False},{False,False,False}}
Scalars and 1-elements are not considered to have the form of a simple m-element since they are not exterior products
◼ Now change the basis to a point basis and consider the additional list of bound elements.
But you can use the bound element predicates to identify the type of element.
Extracting symbols
Extracting symbols
◼ Grassmann symbols are any currently declared scalar symbols, vector symbols, basis elements, metric symbols or special scalars. They also include any particular instances of graded symbols which appear in the expression.
◼ The extraction works by collecting the arguments out of any Grassmann products, complements, sums or ordinary products at all levels. Numerical quantities and symbols (for example π) are ignored.
Examples
Examples
◼ Here is a Grassmann expression. We choose the default basis, default scalar and vector symbols, but declare a general metric. We will apply the various extraction functions in turn to this expression.
Extracting expressions
Extracting expressions
◼ You can extract a list of the pertinent subexpressions from a Grassmann expression by using GrassmannExtract. You can specify what types of expressions to extract by including a predicate or list of predicates as a second argument.
Examples
Examples
◼ Here is how the other functions work on this expression.